<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

//获取微信支付的回调信息
$xml = file_get_contents("php://input");
libxml_disable_entity_loader(true);
$arr = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);

if(empty($arr)){
    Log::info('wxPay error notify');
}else{
    Log::info('wxPay  notify :'.$arr);

    DB::table('sign_trade_creates')->insert([
        'trade' => $arr['out_trade_no'],
        'cash_fee' => $arr['cash_fee'],
        'status' => 1,
    ]);
}


